#include "pandas.h"

Pandas::Pandas():sounds("嘤嘤嘤"),foots(4){	} // 构造器函数定义，声明在头文件中;
Pandas::Pandas(string s):sounds(s),foots(4) {}
void Pandas::say (){cout<<sounds<<endl;}
Pandas& Pandas::combine(const Pandas &otr){
		this->foots +=otr.foots;
		this->sounds +=otr.sounds;
		return *this;
	}
Pandas& Pandas::operator+=(const Pandas &otr){
		return combine(otr);
       }
Pandas Pandas:: operator +(const Pandas &q){
		Pandas c;
		c.foots = this->foots+q.foots;
		c.sounds = this->sounds+q.sounds;
		return c;
	}	
std::ostream & operator<<(std::ostream &out,const  Pandas &p){
		out<<"熊猫总共有"<<p.foots<<"只脚，"<<p.sounds<<"；它们一起叫！";
		return out;
	}	
